#!/usr/bin/env python3
#-*- coding utf-8 -*-
#--------------------
#@author  : xiaowu
#@Time    : 2020/1/19 10:39
#@File    : 04插入单条数据.py
# -------------------------
import pymysql

conn = pymysql.connect("localhost","root","123456","test")

# 获取一个光标
cursor = conn.cursor()

sql = 'insert into EEQA(FIRST_NAME,LAST_NAME,AGE,SEX,INCOME) values(%s,%s,%s,%s,%s)'

FIRST_NAME = "chuizi"
LAST_NAME = "langtou"
AGE = "22"
SEX = "W"
INCOME = 23412

cursor.execute(sql,[FIRST_NAME,LAST_NAME,AGE,SEX,INCOME])

conn.commit()
cursor.close()
conn.close()
